<script>
	import Vue from 'vue';
	// import Auth from './libs/wechat.js';
	export default {
		onLaunch: function(option) {
			// 获取系统信息
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.windowWidth = e.windowWidth;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.windowWidth = e.windowWidth;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;
					// #endif		

					// #ifdef MP-ALIPAY
					Vue.prototype.windowWidth = e.windowWidth;
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			});
			// #ifdef MP
			// 解决ios静音不能播放
			wx.setInnerAudioOption({
				obeyMuteSwitch: false
			});
			// #endif
			// 获取token
			this.$store.dispatch('userInfo/getToken');
		},
		onShow: function() {

		},
		onHide: function() {}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/colorui/main.css";
	@import "@/uni_modules/colorui/icon.css";
	
	// 分享vip
	.share-vip{
		position: fixed;
		padding: 0 20upx;
		bottom: 250upx;
		right: 0upx;
		z-index: 100;
		background-color:  $theme-color;
		font-size: 24upx;
	    color: #fff;
		line-height: 50upx;
		border-radius: 25upx 0 0 25upx;
	}
	

	/*  ios安全区兼容 */
	.ios-safe {
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
		position: relative;
		margin-top: 20upx;
		height: 1upx;

		&::before {
			content: "";
			position: fixed;
			left: 0;
			bottom: 0;
			width: 100vw;
			padding-bottom: constant(safe-area-inset-bottom);
			padding-bottom: env(safe-area-inset-bottom);
			background-color: #fff;
		}
	}

	/*  自定义加载状态 */
	.rloading {
		background-color: #e0e0e0;
		position: relative;
		overflow: hidden;

		&::before {
			content: "";
			display: block;
			width: 100%;
			height: 100%;
			background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
			animation: rloading 1.5s infinite;
		}
	}

	@keyframes rloading {
		0% {
			transform: translateX(-100%);
		}

		100% {
			transform: translateX(100%);
		}
	}
</style>